<template>
  <div v-if="modal.visible" class="modal-backdrop in" @click.stop.prevent="modalHide"></div>
</template>

<script>
  /**
   * 弹窗组件的半黑透明遮层
   */
  import store from 'store/store'

  export default {
    data () {
      return {}
    },
    computed: {
      modal() {
        return store.state.modal
      }
    },
    methods: {
      modalHide () {
        let self = this
        self.$store.dispatch('setModal', {visible: false, modalId: 'backdrop'});
      }
    }
  }
</script>
